<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use App\Http\Requests\Partner RequestPartner;
use App\Http\Controllers\Controller;
use App\Models\Partner;


class PartnerController extends Controller
{
    //
    public function index(Request $request)
    {
    	echo '加盟合作';
    }
    //申请加盟
    public function add_partner(RequestPartner $request)
    {
    	$data = [
            'source_name' => $request->source_name,
            'company_name' => $request->company_name,
            'contact_name' => $request->contact_name,
            'contact_tel' => $request->contact_tel,
            'qq' => $request->qq,
            'email' => $request->email,
            'status' => $request->status,
            'created_at' => date('Y-m-d H:i:s',time()),
            'updated_at' => date('Y-m-d H:i:s',time())
        ];
        $res = Partner::insert($data);
        if($res){
        	return $this->ajax_success('申请成功');
        }else{
        	return $this->ajax_error('未知错误');
        }
    }
}
